import hzcRequest from "../../../utils/https";



// 注册
const getGoodsCarList=(data)=>{
    return hzcRequest.post(`/api/ln/getGoodsCarList`,data)
}

// operateGoodsCar
//操作购物车
const operateGoodsCar=(data)=>{
    return hzcRequest.post(`/api/ln/operateGoodsCar`,data)
}

//清空已失效的
const clearGoodsCar=(data)=>{
    return hzcRequest.post(`/api/ln/clearGoodsCar`,data)
}


//清空已失效的
const delGoodsCar=(data)=>{
    return hzcRequest.post(`/api/ln/delGoodsCar`,data)
}



// 查询用户收藏
const getSelUserCollect = (params) => {
  return hzcRequest.get(`/api/userCollect/selUserCollect`, params);
};


// 添加用户收藏
const saveUserCollectAdd = (params) => {
  return hzcRequest.post(
    `/api/userCollect/saveUserCollect?userId=${params.userId}&prodId=${params.prodId}`
  );
};

// 用户是否收藏
const isUserCollect = (params) => {
  return hzcRequest.get(
    `/api/userCollect/isUserCollect?userId=${params.userId}&prodId=${params.prodId}`
  );
};


// 删除用户收藏
const delUserCollectDelete = (params) => {
  return hzcRequest.delete(
      `/api/userCollect/delUserCollect?userId=${params.userId}&prodId=${params.prodId}`
  );
};

export { getGoodsCarList,operateGoodsCar,delGoodsCar,clearGoodsCar,getSelUserCollect, saveUserCollectAdd, isUserCollect,delUserCollectDelete };
